<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <base href="<%=basePath%>">
    <title>后台管理系统</title>
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo layui-hide-xs layui-bg-black" onclick="go('/welcome')" style="cursor: pointer">
            <div style="display: inline-block; vertical-align: top">
                后台管理系统
            </div>
        </div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide layui-show-md-inline-block" style="margin-right: 100px">
                <a href="javascript:;">用户名</a>
                <dl class="layui-nav-child">
                    <dd><a href="/user/logout">退出登录</a></dd>
                </dl>
            </li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-this">
                    <a class="" href="javascript:;" onclick="go('/welcome')">首页</a>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;" onclick="go('/page/user/list')">用户管理</a>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <iframe id="content" src="/welcome" width="100%" height="100%" frameborder="0"></iframe>
    </div>

</div>

<jsp:include page="/WEB-INF/global/import.jsp"></jsp:include>

<script>
    function go(path) {
        let content = document.querySelector('#content')
        content.setAttribute("src", path)
    }
</script>
</body>
</html>
